home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 37 / hot37.iso / FICHEROS / WEDU / MICSCOP3.ZIP / TESTDIAL.DIR / 00028_Script_Main Scripts < prev    next >
Text File  |  1998-02-07  |  2KB  |  73 lines

  1. global teacher,coursecode, studentName, ACommand
  2. global Attempts                 -- a list of 8, each a list of 4
  3. --                                 8 lessons and 4 tests            
  4. global TestNumber, LessonNumber
  5.  
  6. on InitTakeTest
  7.   InitStudentInfo
  8.   -- put the cursors on the buttons.
  9.   repeat with i = 10 to 12
  10.     set the cursor of sprite i to [the number of member "PH", the number of member "PH_Mask"]
  11.   end repeat
  12. end
  13.  
  14.  
  15. on InitStudentInfo
  16.   if voidP (teacher) then
  17.     set teacher to the text of member "teacher Text"
  18.   end if
  19.   if voidP (coursecode) then
  20.     set coursecode to the text of member "coursecode Text"
  21.   end if
  22.   if voidP (studentName) then
  23.     set studentName to the text of member "studentName Text"
  24.   end if
  25.   set the text of member "teacher Text" to line 1 of teacher
  26.   set the text of member "coursecode Text" to line 1 of coursecode
  27.   set the text of member "studentName Text" to line 1 of studentName
  28. end InitStudentInfo
  29.  
  30. on UpDateStudentInfo
  31.   set teacher to line 1 of the text of member "teacher Text"
  32.   set coursecode to line 1 of the text of member "coursecode Text"
  33.   set studentName to line 1 of the text of member "studentName Text"
  34. end
  35.  
  36. on PressButton aSprite, aCast
  37.   puppetsprite aSprite, True
  38.   set aCastDown to aCast & " Down"
  39.   set the member of sprite aSprite to member aCastDown
  40.   updatestage
  41.   
  42.   repeat while the mouseDown
  43.     nothing
  44.   end repeat
  45.   
  46.   set the member of sprite aSprite to member aCast
  47.   updatestage
  48.   puppetsprite aSprite, False
  49.   
  50. end PressButton
  51.  
  52. on TestNotTaken
  53.   tell the stage to CancelTest
  54.   -- ACommand will remove the attemp that has been added
  55. end 
  56.  
  57. on TakeTest
  58.   -- Update the global variables
  59.   UpdateStudentInfo
  60.   tell the stage
  61.     CloseTestDialogWindow
  62.   end tell
  63.   
  64. end 
  65.  
  66. on UpdateAttempts
  67.   set atestList to getat (Attempts, LessonNumber)
  68.   set aNumber to getat (aTestList,TestNumber)
  69.   set aNumber to aNumber + 1
  70.   deleteAt aTestList, TestNumber
  71.   addat aTestList, TestNumber, aNumber
  72. end UpdateAttempts
  73.